#include "gofgame/jumpdown/sprite/SpikedPedal.h"
#include "gofgame/jumpdown/util/objective-c.h"
#include "SimpleAudioEngine.h"

using namespace gofgame::jumpdown::sprite;
using namespace gofgame::jumpdown::util;
using namespace CocosDenshion;

SpikedPedal::SpikedPedal() {
}

bool SpikedPedal::init() {
	if (!Pedal::initWithSpriteFrameName("ci.png")) {
		delete this;
		return false;
	}
	return true;
}

SpikedPedal::~SpikedPedal() {

}

SpikedPedal *SpikedPedal::createSpikedPedal(){
	SpikedPedal *spikedPedal;
	if (oc_new<SpikedPedal>(&spikedPedal)) {
		spikedPedal->autorelease();
	}
	return spikedPedal;
}


bool SpikedPedal::onTouchHero(Hero* hero) {
	SimpleAudioEngine::sharedEngine()->playEffect("g2normal.wav");
	SimpleAudioEngine::sharedEngine()->playEffect("g2nail.wav");
	hero->hurt();
	return true;
}